// components/input/input.js
var info = {
  title: '',
  // index: '',
  content: ''
}

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    value: {
      type: String,
      value: 'g',
      observer: function (newVal, oldVal) {
        info.content = newVal;
        this.setData({
          value: newVal
        })
      }
    },
    title: {
      type: String,
      observer: function (value) {
        this.setData({
          title: value
        })
      }
    },
    index: {
      type: Number,
      value: '',
      observer: function (index) {
        info.index = index;
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    onTitleChange: function (e) {
      info.title = e.detail.value;
    },

    onValueChange: function (e) {
      info.content = e.detail.value;
      this.triggerEvent('input', info)
    }
  }
})